class TransportsController < ApplicationController
  # GET /transports
  # GET /transports.json
  def index
    @transports = Transport.all

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # GET /transports/1
  # GET /transports/1.json
  def show
    @transport = Transport.find(params[:id])

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # GET /transports/new
  # GET /transports/new.json
  def new
    @transport = Transport.new

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # GET /transports/1/edit
  def edit
    @transport = Transport.find(params[:id])
  end

  # POST /transports
  # POST /transports.json
  def create
    @transport = Transport.new(params[:transport])
    @transports = Transport.all

    respond_to do |format|
      if @transport.save
        format.js { render layout: false }
      end
    end
  end

  # PUT /transports/1
  # PUT /transports/1.json
  def update
    @transport = Transport.find(params[:id])
    @transports = Transport.all
    @transport.update_attributes(params[:transport])

    respond_to do |format|
      format.js { render layout: false }
    end
  end

  # DELETE /transports/1
  # DELETE /transports/1.json
  def destroy
    @transport = Transport.find(params[:id])
    @transport.destroy
    @transports = Transport.all

    respond_to do |format|
      format.js { render layout: false }
    end
  end
end
